package com.woniuxy.meal.controller;


import com.woniuxy.meal.common.Result;
import com.woniuxy.meal.service.FoodTypeService;
import com.woniuxy.meal.service.dto.FoodTypeDto;
import com.woniuxy.meal.service.dto.FoodTypeTreeDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 菜品类型表 前端控制器
 * </p>
 *
 * @author zz
 * @since 2023年06月12日
 */
@RestController
@RequestMapping("/foodType")
@Api(tags = "食物类型模块相关接口")
public class FoodTypeController {

    @Autowired
    private FoodTypeService foodTypeService;



    @ApiOperation("展示所有食品类型")
    @GetMapping("/showFoodTypeTree")
    public Result showFoodTypeTree() throws Exception{
        List<FoodTypeTreeDto> list = foodTypeService.showFoodTypeTree();
        return Result.success(200,"获取所有食品类型成功",list);
    }

    @ApiOperation("展示所有最终食品类型")
    @GetMapping("/showNodeTypeTree")
    public Result showFoodNodeType() throws Exception{
        List<FoodTypeDto> list = foodTypeService.showFoodNodeType();
        return Result.success(200,"获取所有最终食品类型成功",list);
    }





}

